import { Typography } from 'antd'
import React from 'react'

export default function CartItem(props) {
  const {item,onCheckedChange}=props
  const {checked,name,price}=item
  // const onWrappCheckedChange=()=>{
  //   onCheckedChange(item)
  // }
  return (
    <div className='item-card'>
      <div className="checkbox-wrap">
        <input type="checkbox" 
        checked={checked}
       onChange={onCheckedChange.bind(null,item)} 
        />
      </div>
      <p className='item-info'>
        {name}<Typography.Text mark>${price}</Typography.Text>
      </p>
    </div>
  )
}
